﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MMDemo
{
    public partial class StackHanoiForm : Form
    {
        public StackHanoiForm()
        {
            InitializeComponent();
        }

        private void NewHanoiForm_Load(object sender, EventArgs e)
        {
            //this.ControlBox = false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            GlobalStack.HanoiDiskNum = int.Parse(numericUpDown1.Value.ToString());
            PublicDataClass.IsInit = true;
            this.Close();
        }

        protected override void WndProc(ref   Message m)
        {
            const int WM_SYSCOMMAND = 0x0112;
            const int SC_CLOSE = 0xF060;
            if (m.Msg == WM_SYSCOMMAND && (int)m.WParam == SC_CLOSE)
            {
                PublicDataClass.IsInit = false;
                this.Close();
                return;
            }
            base.WndProc(ref m);
        }
    }
}
